//
// Created by Mzoro on 2022/4/19.
//
#include <stdio.h>
int getWord(char word[], int maxLength) {


    char c;
    int length = 0;

    while ((c = getchar()) == ' ' || c == '\n') {
        // 忽略掉连续的空格
    }

    if (c == EOF) {
        return EOF;
    }
    word[length++] = c;
    while ((c = getchar()) != EOF && c != ' ' && c != '\n' && length < maxLength - 2) {
        word[length++] = c;
    }

    if (length == 0) {
        return EOF;
    }
    word[length++] = '\0';
    return length;

}

